<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        * {
          margin: 0;
          padding: 0;
        }
    
        .outer {
          width: 500px;
          height: 500px;
          background-color: pink;
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          margin: auto;
        }
    
        .center {
          width: 300px;
          height: 300px;
          background-color: skyblue;
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          margin: auto;
        }
    
        .inner {
          width: 100px;
          height: 100px;
          background-color: orange;
          position: absolute;
          top: 0;
          left: 600px;
          right: 0;
          bottom: 0;
          margin: auto;
        }
    
        p {
          width: 100px;
          height: 100px;
          background-color: purple;
          position: absolute;
          left: 600px;
          top: 500px;
        }
      </style>
    </head>
    <body>
    
      <div class="outer">
        <div class="center">
          <div class="inner"></div>
        </div>
      </div>
    <!-- inner center outer body html document window -->
    
    
      <p></p>
    <script>
        // var btn = document.querySelector('button');
        // btn.onclick  = function(e){
        //     alert(e|| window.event)
        // }
    //ie阻止事件转播的方式  
    document.querySelector('.inner').addEventListener('click',function(e){e = e || window.event;e.cancelBubble=true;alert('inner')});
    document.querySelector('.center').addEventListener('click',function(){alert('center')});
    document.querySelector('.outer').addEventListener('click',function(){alert('outer')});
    document.body.addEventListener('click',function(){alert('body')});
    document.documentElement.addEventListener('click',function(){alert('html')});
    document.addEventListener('click',function(){alert('document')});
    window.addEventListener('click',function(){alert('window')});




    </script>
</body>
</html>